package com.cncytech.uiautomator_demo;

import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;

/**
 * 自定义runner的主要作用是田间监听器， 可以通过manifest 配置
 * @  <instrumentation
 *         android:name="androidx.test.runner.AndroidJUnitRunner"
 *         android:targetPackage="com.cncytech.uiautomator_demo.testcase">
 *         <meta-data
 *             android:name="listener"
 *             android:value="com.cncytech.uiautomator_demo.IListener"
 *             />
 *     </instrumentation>
 */
public class IRunner extends BlockJUnit4ClassRunner {
    private static final IListener listener = new IListener();

    /**
     * Creates a BlockJUnit4ClassRunner to run {@code klass}
     *
     * @param klass
     * @throws InitializationError if the test class is malformed.
     */
    public IRunner(Class<?> klass) throws InitializationError {
        super(klass);
    }

    @Override
    public void run(RunNotifier notifier) {
    /*    notifier.removeListener(listener);
        notifier.addListener(listener);*/
        super.run(notifier);
    }
}